// 导入fs模板
const fs = require('fs')

fs.stat('./座右铭.txt', (err, stats) => {
  if (err) {
    console.log(err)
  } else {
    console.log(stats)
    // 输出内容：
    /*
      Stats {
        dev: 2425234216,
        mode: 33206,
        nlink: 1,
        uid: 0,
        gid: 0,
        rdev: 0,
        blksize: 4096,
        ino: 281474977301909,
        size: 134,
        blocks: 0,
        atimeMs: 1701781411919.2112,
        mtimeMs: 1701613439709.0442,
        ctimeMs: 1701613439709.0442,
        birthtimeMs: 1701441831619.2163,
        atime: 2023-12-05T13:03:31.919Z,
        mtime: 2023-12-03T14:23:59.709Z,
        ctime: 2023-12-03T14:23:59.709Z,
        birthtime: 2023-12-01T14:43:51.619Z
      }
    */

    console.log(stats.isFile());   // 是否是文件   true
    console.log(stats.isDirectory());   // 是否是文件夹   false
    console.log(stats.isBlockDevice());   // 是否是块设备   false
  }
})